class Solution {
public:
    vector<string> sortPeople(vector<string>& names, vector<int>& heights) {
        int sz = heights.size();
        vector<int> index(sz);
        for(int i = 0; i < sz; ++i)
        {
            index[i] = i;
        }
        sort(index.begin(), index.end(),[&](int index1, int index2)
        {
            return heights[index1] > heights[index2];
        });
 
        vector<string> ret;
        for(auto& e : index)
        {
            ret.push_back(names[e]);
        }
        return ret;
    }
};